<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script src="http://static.wx5.com/admin/bower_components/jquery/dist/jquery.min.js"></script>
</head>
<body>
  <div class="generate">222222</div>
</body>
<script>
  $(function() {
    $(".generate").on("click", function() {
      if (!confirm("确定生成？")) {
        return false;
      }
      var generate_id = $(this).data('id');
      var url = "/LiveSalary/generateMonthSalary";
      var data = { id: generate_id };
      $.ajax({
        async: true,
        type: "POST",
        url: url,
        data: data,
        dataType: "json",
        timeout: 7000,
        beforeSend: function() {
          var tips = '\
                <div class="logistics-content">\
                    <div class="logi-content">\
                        <img src="http://res11.xesimg.com/x5home_2.0/common/img/monkey_buy.png"></br>\
                            <span>' + '查询物流中' + '</span>\
                    </div>\
                </div>';
          createModal.show({
            id: 'loadingShow',
            title: '订单跟踪',
            cls: 'loadingShow',
            width: 730,
            content: tips
          });
          $('#loadingShow').modal({
            backdrop: 'static',
            keyboard: false,
            show: true
          });
        },
        success: function(result) {
          $('#loadingShow').hide()
          if (!result.stat) {
            // alert(result.data);
          } else {
             alert(result.data);
            var condition = '';
            condition = condition + 'year=' + $('#year').val();
            condition = condition + '&curPage=' + '<?php echo $curPage;?>';
            window.location.href = '/LiveSalary/getLiveMonthSalaryRecord?' + condition;
          }
        },
        error: function() {
          alert('服务器异常，请联系开发老师。');
        },
        complete: function() {}
      });
    })
  });
</script>
</html>
